const TokenKey = 'App-Token'

export function getToken() {
  return uni.getStorageSync(TokenKey)
}

export function setToken(token) {
  return uni.setStorageSync(TokenKey, token)
}

export function removeToken() {
  return uni.removeStorageSync(TokenKey)
}

/**
 * 解析url中的参数
 */
export function UrlParamHash(url) {
	var params = {},
		h;
	var hash = url.slice(url.indexOf("?") + 1).split("&");
	for (var i = 0; i < hash.length; i++) {
		h = hash[i].split("=");
		if (h.length > 1) {
			params[h[0]] = h[1];
		} else {
			params[h[0]] = "";
		}
	}
	return params;
}